package com.wanmait.hr.service.Impl;

import com.wanmait.hr.mapper.PostMapper;
import com.wanmait.hr.service.PostService;
import com.wanmait.hr.util.Pager;
import com.wanmait.hr.vo.Post;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**PostServiceImpl class
 *
 * @author 王志斌
 * @date 2019-02-08
 * */
@Service
public class PostServiceImpl implements PostService {
    @Resource
    private PostMapper postMapper;

    @Override
    public List<Post> getPost() {//获得职务
        return postMapper.getPost();
    }

    /**获取所有的岗位_王志斌
     * @return List<Post> getAllPost
     * */
    @Override
    public List<Post> getAllPost(Pager pager) {
        return postMapper.getAllPost(pager);
    }

    /**新增岗位_王志斌
     * @param post
     * */
    @Override
    public void insertPost(Post post) {
        postMapper.insertPost(post);
    }

    /**修改岗位时根据id获取岗位信息_王志斌
     * @param postId
     * @return Post postInfo
     * */
    @Override
    public Post postInfo(Integer postId) {
        return postMapper.postInfo(postId);
    }

    /**修改岗位_王志斌
     * @param post
     * */
    @Override
    public void updatePost(Post post) {
        postMapper.updatePost(post);
    }

    /**删除岗位_王志斌
     * @param postId
     * */
    @Override
    public void delPost(Integer postId) {
        postMapper.delPost(postId);
    }

    /**根据岗位类别获取岗位信息-Ajax回调_王志斌
     * @param postTypeId
     * @return List<Post> postInfoById
     * */
    @Override
    public List<Post> postInfoById(Integer postTypeId) {
        return postMapper.postInfoById(postTypeId);
    }

    /**根据部门id获取岗位信息-Ajax回调_王志斌
     * @param departId
     * @return List<Post> postInfoByDepartId
     * */
    @Override
    public List<Post> postInfoByDepartId(Integer departId) {
        return postMapper.postInfoByDepartId(departId);
    }

    /**获取岗位的总条数
     * @return Integer
     * */
    @Override
    public Integer dataCount() {
        return postMapper.dataCount();
    }


}
